import request from '../utils/request'

//获取上门服务初始内容
export function placeorderpage() {
  return request.ajax({
    url: `/doorserver/placeorderpage`,
    method: 'post'
  })
}

//获取预约时间/client/doorserver/listCanAppointmentTimeFrame
export function appointmentTime(params) {
  return request.ajax({
    url: `/doorserver/listCanAppointmentTimeFrame?appointmentDate=${params}`,
    method: 'post'
  })
}

//获取省市区/client/region/regionList
export function getRegion(data) {
  return request.ajax({
    url: `/region/regionList`,
    method: 'post',
    isJson: true,
    data: data
  })
}

//上传图片/client/common/upload
export function uploadImg(path) {
  return request.ajax({
    url: `/common/upload?tempFilePath=${path}`,
    method: 'post',
    data: {}
  })
}

//获取下级栏目/client/doorserver/classifylist
export function getTwoChannel(data) {
  return request.ajax({
    url: `/doorserver/classifylist`,
    method: 'post',
    data: data,
    isJson: true
  })
}

//获取项目价格/client/doorserver/getDoorserverPrice
export function getDoorPrice(params) {
  return request.ajax({
    url: `/doorserver/getDoorserverPrice?classifyId=${params.classifyId}&classifyCid=${params.classifyCid}&grade=${params.grade}`,
    method: 'post'
  })
}

//生成上门预约叮当/client/order/createDoorserver
export function createOrder(data) {
  return request.ajax({
    url: `/order/createDoorserver`,
    method: 'post',
    data: data,
    isJson: true
  })
}


//上门预约订单列表/client/doorserver/doorserverOrderList
export function doorserverList(query) {
  return request.ajax({
    url: `/doorserver/doorserverOrderList?pageNum=${query.pageNum}&pageSize=${query.pageSize}&orderState=${query.orderState}`,
    method: 'get'
  })
}

//上门预约订单详情/client/doorserver/doorserverOrderDetail
export function doorserverDetail(id) {
  return request.ajax({
    url: `/doorserver/doorserverOrderDetail?id=${id}`,
    method: 'post'
  })
}

//积分/client/mall/integral/getMyIntegral
export function getIntegral(params) {
  return request.ajax({
    url: `/mall/integral/getMyIntegral?pageNum=${params.pageNum}&pageSize=${params.pageSize}`,
    method: 'post'
  })
}